package com.qiandw.common.cassandra

import java.util.List

import com.datastax.driver.core.{ResultSet, Statement}
import com.datastax.driver.mapping.Mapper

/**
  * cassandra dao服务，暴露AbstractCassandraDao的部分方法
  * Created by Liang Dong on 2016/12/21.
  */
trait CassandraDaoSrv {

  def get[T](t: Class[T], ids: Object*): T

  def save[T](obj: T, t: Class[T]): Unit

  def saveQuery[T](obj: T, t: Class[T]): Statement

  def del[T](t: Class[T], ids: Object*): Unit

  def Execute(statement: Statement):ResultSet

  def Execute(cql: String): ResultSet

  def saveIfNotExists[T](obj: T, t: Class[T]): Boolean

  def executeAndPrintAsJson(statement: Statement): String

  def getDefaultKeyspace: String

  def getTableNames: List[String]

  def getViewNames: List[String]

  def getMapper[T](t: Class[T]): Mapper[T]
}
